package org.jeecg.modules.demo.tj.service.impl;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.demo.api.mapper.ApiInfoMapper;
import org.jeecg.modules.demo.tj.mapper.TjInfoMapper;
import org.jeecg.modules.demo.tj.service.ITjInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;
import java.util.Map;

/**
 * @Description: aj_info
 * @Author: jeecg-boot
 * @Date:   2023-10-27
 * @Version: V1.0
 */
@Service
public class TjInfoServiceImpl  implements ITjInfoService {
    @Autowired
    private TjInfoMapper tjInfoMapper;
    @Autowired
    private ApiInfoMapper apiInfoMapper;
    @Override

    public JSONObject getshxx(String orgcode,String userid) {
        JSONObject tmpRet = new JSONObject();
        try{
            Integer fy = apiInfoMapper.getuserFeature(userid,"1730137636376555521"); //复印审核
            Integer dy2 = apiInfoMapper.getuserFeature(userid,"1730137865066786818"); //调用复审
            Integer dy1 = apiInfoMapper.getuserFeature(userid,"1730137769117888514"); //调用初审

            tmpRet.put("data",tjInfoMapper.getshxx(orgcode,fy,dy1,dy2));
            tmpRet.put("code", "0");
        }
        catch(Exception ex){
            tmpRet.put("code", "1");
            tmpRet.put("msg", ex.toString());
        }
        return tmpRet;
    }
    public JSONObject getryxx(String orgcode,String userid){
        JSONObject tmpRet = new JSONObject();
        try{
            tmpRet.put("data",tjInfoMapper.getryxx(orgcode));
            tmpRet.put("code", "0");

        }catch (Exception ex){
            tmpRet.put("code", "1");
            tmpRet.put("msg", ex.toString());
        }
        return tmpRet;
    }
    public JSONObject getrytjxx(String orgcode,String userid){
        JSONObject tmpRet = new JSONObject();
        try{
            tmpRet.put("rysl",tjInfoMapper.getrysl(orgcode));
            tmpRet.put("wjsl",tjInfoMapper.getwjsl(orgcode));
            tmpRet.put("mlsl",tjInfoMapper.getmlsl(orgcode));
            tmpRet.put("wjsize",tjInfoMapper.getwjsize(orgcode));
            tmpRet.put("code", "0");

        }catch (Exception ex){
            tmpRet.put("code", "1");
            tmpRet.put("msg", ex.toString());
        }
        return tmpRet;
    }

    public JSONObject getazfstjxx(String orgcode,String userid){
        JSONObject tmpRet = new JSONObject();
        try{
            tmpRet.put("data",tjInfoMapper.getazfstjxx(orgcode));
            tmpRet.put("code", "0");

        }catch (Exception ex){
            tmpRet.put("code", "1");
            tmpRet.put("msg", ex.toString());
        }
        return tmpRet;
    }
    public JSONObject getazdtjxx(String orgcode,String userid){
        JSONObject tmpRet = new JSONObject();
        try{
            tmpRet.put("data",tjInfoMapper.getazdtjxx(orgcode));
            tmpRet.put("code", "0");

        }catch (Exception ex){
            tmpRet.put("code", "1");
            tmpRet.put("msg", ex.toString());
        }
        return tmpRet;
    }
    public JSONObject getjktjxx(String orgcode,String userid){
        JSONObject tmpRet = new JSONObject();
        try{
            tmpRet.put("data",tjInfoMapper.getjktjxx(orgcode));
            tmpRet.put("code", "0");

        }catch (Exception ex){
            tmpRet.put("code", "1");
            tmpRet.put("msg", ex.toString());
        }
        return tmpRet;
    }
}
